package cn.qingyun.gis.modules.scenes.feign;

import cn.qingyun.gis.modules.middle.api.standard.response.RgeoAddressVo;
import cn.qingyun.gis.modules.scenes.feign.fallback.PoiDetailServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotEmpty;

@Component
@FeignClient(name = "scenes-svc", url = "${qingyun.feign.url.middle-government:http://127.0.0.1}", fallback = PoiDetailServiceFallback.class)
public interface PoiDetailClientService {
    /**
     * 调用工单详情接口
     * @param gdId 高德id
     * @return
     */
    @GetMapping(value = "/feign/specific/scenes/queryRgeoAddrByGdId", produces = "application/json")
    RgeoAddressVo queryRgeoAddrByGdId(@RequestParam(value = "gdId", required = false) @NotEmpty(message = "高德ID不能为空") String gdId);

    /**
     * 修改商家电话
     * @param gdId
     * @param telephone
     * @return
     */
    @GetMapping(value = "/feign/specific/scenes/updateTelephone", produces = "application/json")
    Boolean updateTelephone(@RequestParam(value = "gdId", required = false) @NotEmpty(message = "高德ID不能为空") String gdId,
                            @RequestParam(value = "telephone", required = false) @NotEmpty(message = "商家电话不能为空") String telephone);
}

